#pragma once
#include <QMap>
#include <QObject>

#include "ManagerBase.h"
#include "../room/AbstractRoom.h"
#include "../user/AbstractUser.h"

class RoomManager : public QObject, public ManagerBase<RoomManager> {
    Q_OBJECT
public:
    quint16 createRoom();
    void deleteRoom(quint16 roomId);
    bool addClientToRoom(const quint16& roomId, AbstractUser*& user, AbstractRoom*& getRoom);
    bool removeClientFromRoom(const quint16& roomId, const quint16& userId, AbstractRoom*& getRoom);
    QVector<quint16> getClientIDsInRoom(const quint16& roomId) const;
private:
    QMap<quint16, AbstractRoom*> roomMap;
    quint16 nextRoomId = 1000;
};
